﻿using System;
using System.Collections.Generic;
using System.Xml;

namespace YJKArchStandard
{
	public class StairArchStd : IArchStdOperation
	{
		public static StairArchStd GetInstance(string sNodeName, string sFilepath)
		{
			return new StairArchStd(sNodeName, sFilepath);
		}

		private StairArchStd(string sNodeName, string sFilepath)
		{
			StairArchStd.m_ListCheckData = new List<StairArchStdData>();
			StairArchStd.m_DicCheckLandData = new Dictionary<string, BaseStairArchStdLandData>();
			StairArchStd.m_DicCheckRunData = new Dictionary<string, BaseStairArchStdLadderDataNew>();
			StairArchStd.m_ClearHeightData = new StairsClearHeightData();
			this.LoadStairsRange(sNodeName, sFilepath);
		}

		private int toInt(string str)
		{
			return Convert.ToInt32(str);
		}

		private double toDouble(string str)
		{
			return Convert.ToDouble(str);
		}

		private StairArchStdData ReadResidenceXmlData(XmlNode node, StairArchStdBuildingType BuildType)
		{
			StairArchStdData stairArchStdData = new StairArchStdData();
			stairArchStdData.m_StairArchStdBuildType = BuildType;
			stairArchStdData.m_sArchStdName = "08BJ7-1";
			int num = 0;
			num++;
			int stairArchStdLimitType = this.toInt(node.ChildNodes[num++].InnerText);
			double dStairArchStdLadderSevenWidth = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdLadderSixWidth = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdTreadHeight = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdTreadWidth = this.toDouble(node.ChildNodes[num++].InnerText);
			num++;
			int stairArchStdLimitType2 = this.toInt(node.ChildNodes[num++].InnerText);
			double dStairArchStdLadderNearSpaceWidth = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdLadderTwoSideWidth = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdTreadHeight2 = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdTreadWidth2 = this.toDouble(node.ChildNodes[num++].InnerText);
			num++;
			int stairArchStdLimitType3 = this.toInt(node.ChildNodes[num++].InnerText);
			double dStairArchStdTreadHeight3 = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdTreadWidth3 = this.toDouble(node.ChildNodes[num++].InnerText);
			num++;
			int stairArchStdLimitType4 = this.toInt(node.ChildNodes[num++].InnerText);
			double dStairArchStdTreadHeight4 = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdTreadWidth4 = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdRailHight = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdRailSpace = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdLandWidth = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdRailHorizontalLength = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdRailHorizontalHight = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdLadderHeight = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdLandHeight = this.toDouble(node.ChildNodes[num++].InnerText);
			string innerText = node.ChildNodes[num++].InnerText;
			BaseStairArchStdLandData baseStairArchStdLandData = new BaseStairArchStdLandData();
			baseStairArchStdLandData.m_dStairArchStdLandWidth = dStairArchStdLandWidth;
			baseStairArchStdLandData.m_dStairArchStdLandHeight = dStairArchStdLandHeight;
			ResidenceStairArchStdRailData residenceStairArchStdRailData = new ResidenceStairArchStdRailData();
			residenceStairArchStdRailData.m_dStairArchStdRailHight = dStairArchStdRailHight;
			residenceStairArchStdRailData.m_dStairArchStdRailSpace = dStairArchStdRailSpace;
			residenceStairArchStdRailData.m_dStairArchStdRailHorizontalLength = dStairArchStdRailHorizontalLength;
			residenceStairArchStdRailData.m_dStairArchStdRailHorizontalHight = dStairArchStdRailHorizontalHight;
			BaseStairArchStdLimitCondition baseStairArchStdLimitCondition = new BaseStairArchStdLimitCondition();
			baseStairArchStdLimitCondition.m_StairArchStdLimitType = (StairArchStdLimitConditionType)stairArchStdLimitType;
			baseStairArchStdLimitCondition.m_StairArchStdLadderData = new ResidencePubicStairArchStdLadderData
			{
				m_dStairArchStdLadderSevenWidth = dStairArchStdLadderSevenWidth,
				m_dStairArchStdLadderSixWidth = dStairArchStdLadderSixWidth,
				m_dStairArchStdTreadHeight = dStairArchStdTreadHeight,
				m_dStairArchStdTreadWidth = dStairArchStdTreadWidth,
				m_dStairArchStdLadderHeight = dStairArchStdLadderHeight
			};
			BaseStairArchStdLimitCondition baseStairArchStdLimitCondition2 = new BaseStairArchStdLimitCondition();
			baseStairArchStdLimitCondition2.m_StairArchStdLimitType = (StairArchStdLimitConditionType)stairArchStdLimitType2;
			baseStairArchStdLimitCondition2.m_StairArchStdLadderData = new ResidenceIndoorStairArchStdLadderData
			{
				m_dStairArchStdLadderNearSpaceWidth = dStairArchStdLadderNearSpaceWidth,
				m_dStairArchStdLadderTwoSideWidth = dStairArchStdLadderTwoSideWidth,
				m_dStairArchStdTreadHeight = dStairArchStdTreadHeight2,
				m_dStairArchStdTreadWidth = dStairArchStdTreadWidth2
			};
			BaseStairArchStdLimitCondition baseStairArchStdLimitCondition3 = new BaseStairArchStdLimitCondition();
			baseStairArchStdLimitCondition3.m_StairArchStdLimitType = (StairArchStdLimitConditionType)stairArchStdLimitType3;
			baseStairArchStdLimitCondition3.m_StairArchStdLadderData = new BaseStairArchStdLadderData
			{
				m_dStairArchStdTreadHeight = dStairArchStdTreadHeight3,
				m_dStairArchStdTreadWidth = dStairArchStdTreadWidth3
			};
			BaseStairArchStdLimitCondition baseStairArchStdLimitCondition4 = new BaseStairArchStdLimitCondition();
			baseStairArchStdLimitCondition4.m_StairArchStdLimitType = (StairArchStdLimitConditionType)stairArchStdLimitType4;
			baseStairArchStdLimitCondition4.m_StairArchStdLadderData = new BaseStairArchStdLadderData
			{
				m_dStairArchStdTreadHeight = dStairArchStdTreadHeight4,
				m_dStairArchStdTreadWidth = dStairArchStdTreadWidth4
			};
			stairArchStdData.m_ListStairArchStdCondition.Add(baseStairArchStdLimitCondition);
			stairArchStdData.m_ListStairArchStdCondition.Add(baseStairArchStdLimitCondition2);
			stairArchStdData.m_ListStairArchStdCondition.Add(baseStairArchStdLimitCondition3);
			stairArchStdData.m_ListStairArchStdCondition.Add(baseStairArchStdLimitCondition4);
			stairArchStdData.m_StairArchStdLandData = baseStairArchStdLandData;
			stairArchStdData.m_StairArchStdRailData = residenceStairArchStdRailData;
			stairArchStdData.m_sStairArchStdReMark = innerText;
			return stairArchStdData;
		}

		private StairArchStdData ReadKindergartenXmlData(XmlNode node, StairArchStdBuildingType BuildType)
		{
			StairArchStdData stairArchStdData = new StairArchStdData();
			stairArchStdData.m_StairArchStdBuildType = BuildType;
			stairArchStdData.m_sArchStdName = "08BJ7-1";
			int num = 0;
			num++;
			int stairArchStdLimitType = this.toInt(node.ChildNodes[num++].InnerText);
			double dStairArchStdTreadHeight = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdTreadWidth = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdRailHight = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdRailSpace = this.toDouble(node.ChildNodes[num++].InnerText);
			string innerText = node.ChildNodes[num++].InnerText;
			BaseStairArchStdLadderData baseStairArchStdLadderData = new BaseStairArchStdLadderData();
			baseStairArchStdLadderData.m_dStairArchStdTreadHeight = dStairArchStdTreadHeight;
			baseStairArchStdLadderData.m_dStairArchStdTreadWidth = dStairArchStdTreadWidth;
			BaseStairArchStdLimitCondition baseStairArchStdLimitCondition = new BaseStairArchStdLimitCondition();
			baseStairArchStdLimitCondition.m_StairArchStdLimitType = (StairArchStdLimitConditionType)stairArchStdLimitType;
			baseStairArchStdLimitCondition.m_StairArchStdLadderData = baseStairArchStdLadderData;
			BaseStairArchStdRailData baseStairArchStdRailData = new BaseStairArchStdRailData();
			baseStairArchStdRailData.m_dStairArchStdRailHight = dStairArchStdRailHight;
			baseStairArchStdRailData.m_dStairArchStdRailSpace = dStairArchStdRailSpace;
			stairArchStdData.m_StairArchStdLandData = null;
			stairArchStdData.m_StairArchStdRailData = baseStairArchStdRailData;
			stairArchStdData.m_ListStairArchStdCondition.Add(baseStairArchStdLimitCondition);
			return stairArchStdData;
		}

		private StairArchStdData ReadMidLittleSchoolXmlData(XmlNode node, StairArchStdBuildingType BuildType)
		{
			StairArchStdData stairArchStdData = new StairArchStdData();
			stairArchStdData.m_StairArchStdBuildType = BuildType;
			stairArchStdData.m_sArchStdName = "08BJ7-1";
			int num = 0;
			num++;
			int stairArchStdLimitType = this.toInt(node.ChildNodes[num++].InnerText);
			double dStairArchStdLadderWidth = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdSlope = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdIndoorRailHight = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdOutdoorRailHight = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdRailSpace = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdRailHorizontalLength = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdRailHorizontalHight = this.toDouble(node.ChildNodes[num++].InnerText);
			string innerText = node.ChildNodes[num++].InnerText;
			SchoolStairArchStdLadderData schoolStairArchStdLadderData = new SchoolStairArchStdLadderData();
			schoolStairArchStdLadderData.m_dStairArchStdLadderWidth = dStairArchStdLadderWidth;
			schoolStairArchStdLadderData.m_dStairArchStdSlope = dStairArchStdSlope;
			BaseStairArchStdLimitCondition baseStairArchStdLimitCondition = new BaseStairArchStdLimitCondition();
			baseStairArchStdLimitCondition.m_StairArchStdLimitType = (StairArchStdLimitConditionType)stairArchStdLimitType;
			baseStairArchStdLimitCondition.m_StairArchStdLadderData = schoolStairArchStdLadderData;
			SchoolStairArchStdRailData schoolStairArchStdRailData = new SchoolStairArchStdRailData();
			schoolStairArchStdRailData.m_dStairArchStdRailSpace = dStairArchStdRailSpace;
			schoolStairArchStdRailData.m_dStairArchStdIndoorRailHight = dStairArchStdIndoorRailHight;
			schoolStairArchStdRailData.m_dStairArchStdOutdoorRailHight = dStairArchStdOutdoorRailHight;
			schoolStairArchStdRailData.m_dStairArchStdRailHorizontalLength = dStairArchStdRailHorizontalLength;
			schoolStairArchStdRailData.m_dStairArchStdRailHorizontalHight = dStairArchStdRailHorizontalHight;
			stairArchStdData.m_sStairArchStdReMark = innerText;
			stairArchStdData.m_StairArchStdLandData = null;
			stairArchStdData.m_StairArchStdRailData = schoolStairArchStdRailData;
			stairArchStdData.m_ListStairArchStdCondition.Add(baseStairArchStdLimitCondition);
			return stairArchStdData;
		}

		private StairArchStdData ReadShopXmlData(XmlNode node, StairArchStdBuildingType BuildType)
		{
			StairArchStdData stairArchStdData = new StairArchStdData();
			stairArchStdData.m_StairArchStdBuildType = BuildType;
			stairArchStdData.m_sArchStdName = "08BJ7-1";
			int num = 0;
			num++;
			int stairArchStdLimitType = this.toInt(node.ChildNodes[num++].InnerText);
			double dStairArchStdLadderWidth = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdTreadHeight = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdTreadWidth = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdIndoorRailHight = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdOutdoorRailHight = this.toDouble(node.ChildNodes[num++].InnerText);
			string innerText = node.ChildNodes[num++].InnerText;
			BaseStairArchStdLadderData baseStairArchStdLadderData = new BaseStairArchStdLadderData();
			baseStairArchStdLadderData.m_dStairArchStdLadderWidth = dStairArchStdLadderWidth;
			baseStairArchStdLadderData.m_dStairArchStdTreadHeight = dStairArchStdTreadHeight;
			baseStairArchStdLadderData.m_dStairArchStdTreadWidth = dStairArchStdTreadWidth;
			BaseStairArchStdLimitCondition baseStairArchStdLimitCondition = new BaseStairArchStdLimitCondition();
			baseStairArchStdLimitCondition.m_StairArchStdLimitType = (StairArchStdLimitConditionType)stairArchStdLimitType;
			baseStairArchStdLimitCondition.m_StairArchStdLadderData = baseStairArchStdLadderData;
			ShopStairArchStdRailData shopStairArchStdRailData = new ShopStairArchStdRailData();
			shopStairArchStdRailData.m_dStairArchStdIndoorRailHight = dStairArchStdIndoorRailHight;
			shopStairArchStdRailData.m_dStairArchStdOutdoorRailHight = dStairArchStdOutdoorRailHight;
			stairArchStdData.m_ListStairArchStdCondition.Add(baseStairArchStdLimitCondition);
			stairArchStdData.m_sStairArchStdReMark = innerText;
			stairArchStdData.m_StairArchStdLandData = null;
			stairArchStdData.m_StairArchStdRailData = shopStairArchStdRailData;
			return stairArchStdData;
		}

		private StairArchStdData ReadHospitalXmlData(XmlNode node, StairArchStdBuildingType BuildType)
		{
			StairArchStdData stairArchStdData = new StairArchStdData();
			stairArchStdData.m_StairArchStdBuildType = BuildType;
			stairArchStdData.m_sArchStdName = "08BJ7-1";
			int num = 0;
			num++;
			int stairArchStdLimitType = this.toInt(node.ChildNodes[num++].InnerText);
			double dStairArchStdLadderWidth = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdTreadHeight = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdTreadWidth = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdLandWidth = this.toDouble(node.ChildNodes[num++].InnerText);
			string innerText = node.ChildNodes[num++].InnerText;
			BaseStairArchStdLadderData baseStairArchStdLadderData = new BaseStairArchStdLadderData();
			baseStairArchStdLadderData.m_dStairArchStdLadderWidth = dStairArchStdLadderWidth;
			baseStairArchStdLadderData.m_dStairArchStdTreadHeight = dStairArchStdTreadHeight;
			baseStairArchStdLadderData.m_dStairArchStdTreadWidth = dStairArchStdTreadWidth;
			BaseStairArchStdLimitCondition baseStairArchStdLimitCondition = new BaseStairArchStdLimitCondition();
			baseStairArchStdLimitCondition.m_StairArchStdLimitType = (StairArchStdLimitConditionType)stairArchStdLimitType;
			baseStairArchStdLimitCondition.m_StairArchStdLadderData = baseStairArchStdLadderData;
			BaseStairArchStdLandData baseStairArchStdLandData = new BaseStairArchStdLandData();
			baseStairArchStdLandData.m_dStairArchStdLandWidth = dStairArchStdLandWidth;
			stairArchStdData.m_sStairArchStdReMark = innerText;
			stairArchStdData.m_ListStairArchStdCondition.Add(baseStairArchStdLimitCondition);
			stairArchStdData.m_StairArchStdLandData = baseStairArchStdLandData;
			stairArchStdData.m_StairArchStdRailData = null;
			return stairArchStdData;
		}

		private StairArchStdData ReadOldPeopleBuildingXmlData(XmlNode node, StairArchStdBuildingType BuildType)
		{
			StairArchStdData stairArchStdData = new StairArchStdData();
			stairArchStdData.m_StairArchStdBuildType = BuildType;
			stairArchStdData.m_sArchStdName = "08BJ7-1";
			int num = 0;
			num++;
			int stairArchStdLimitType = this.toInt(node.ChildNodes[num++].InnerText);
			double dStairArchStdLadderWidth = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdTreadHomeHeight = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdTreadHomeWidth = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdTreadPublicHeight = this.toDouble(node.ChildNodes[num++].InnerText);
			double dStairArchStdTreadPublicWidth = this.toDouble(node.ChildNodes[num++].InnerText);
			string innerText = node.ChildNodes[num++].InnerText;
			OldStairArchStdLadderData oldStairArchStdLadderData = new OldStairArchStdLadderData();
			oldStairArchStdLadderData.m_dStairArchStdLadderWidth = dStairArchStdLadderWidth;
			oldStairArchStdLadderData.m_dStairArchStdTreadHomeHeight = dStairArchStdTreadHomeHeight;
			oldStairArchStdLadderData.m_dStairArchStdTreadHomeWidth = dStairArchStdTreadHomeWidth;
			oldStairArchStdLadderData.m_dStairArchStdTreadPublicHeight = dStairArchStdTreadPublicHeight;
			oldStairArchStdLadderData.m_dStairArchStdTreadPublicWidth = dStairArchStdTreadPublicWidth;
			BaseStairArchStdLimitCondition baseStairArchStdLimitCondition = new BaseStairArchStdLimitCondition();
			baseStairArchStdLimitCondition.m_StairArchStdLimitType = (StairArchStdLimitConditionType)stairArchStdLimitType;
			baseStairArchStdLimitCondition.m_StairArchStdLadderData = oldStairArchStdLadderData;
			stairArchStdData.m_sStairArchStdReMark = innerText;
			stairArchStdData.m_ListStairArchStdCondition.Add(baseStairArchStdLimitCondition);
			stairArchStdData.m_StairArchStdLandData = null;
			stairArchStdData.m_StairArchStdRailData = null;
			return stairArchStdData;
		}

		private XmlNode GetNodeBySpecifyStdId(string sStdId, XmlDocument xmlDoc)
		{
			XmlNode result = null;
			foreach (object obj in xmlDoc.DocumentElement.ChildNodes)
			{
				XmlNode xmlNode = (XmlNode)obj;
				if (xmlNode.Attributes["id"].Value.Equals(sStdId))
				{
					result = xmlNode;
					break;
				}
			}
			return result;
		}

		public bool LoadStairsRange(string sNodeName, string sFilepath)
		{
			bool result = true;
			try
			{
				XmlDocument xmlDocument = new XmlDocument();
				xmlDocument.Load(sFilepath);
				XmlNode nodeBySpecifyStdId = this.GetNodeBySpecifyStdId("08BJ7-1", xmlDocument);
				if (nodeBySpecifyStdId != null && nodeBySpecifyStdId != null)
				{
					foreach (object obj in nodeBySpecifyStdId.ChildNodes)
					{
						XmlNode xmlNode = (XmlNode)obj;
						BaseStairArchStdLadderDataNew baseStairArchStdLadderDataNew = new BaseStairArchStdLadderDataNew();
						XmlElement xmlElement = (XmlElement)xmlNode;
						xmlElement.GetAttribute("id");
						string attribute = xmlElement.GetAttribute("name");
						XmlNodeList childNodes = xmlElement.ChildNodes;
						if (string.IsNullOrEmpty(attribute))
						{
							StairArchStd.m_ClearHeightData.m_dStairArchStdLadderHeight = (double)int.Parse(childNodes[0].InnerText);
							StairArchStd.m_ClearHeightData.m_dStairArchStdLandHeightMin = (double)int.Parse(childNodes[1].InnerText);
							StairArchStd.m_ClearHeightData.m_dStairArchStdLandHeightMax = (double)int.Parse(childNodes[2].InnerText);
						}
						else
						{
							baseStairArchStdLadderDataNew.m_dStairArchStdTreadDepth = (double)int.Parse(childNodes[0].InnerText);
							baseStairArchStdLadderDataNew.m_dStairArchStdTreadHeight = (double)int.Parse(childNodes[1].InnerText);
							baseStairArchStdLadderDataNew.m_dStairArchStdLadderWidth = (double)int.Parse(childNodes[2].InnerText);
							BaseStairArchStdLandData baseStairArchStdLandData = new BaseStairArchStdLandData();
							if (childNodes.Count == 4)
							{
								baseStairArchStdLandData.m_dStairArchStdLandWidth = (double)int.Parse(childNodes[3].InnerText);
							}
							else if (childNodes.Count == 3)
							{
								baseStairArchStdLandData.m_dStairArchStdLandWidth = 0.0;
							}
							StairArchStd.m_DicCheckRunData.Add(attribute, baseStairArchStdLadderDataNew);
							StairArchStd.m_DicCheckLandData.Add(attribute, baseStairArchStdLandData);
						}
					}
				}
			}
			catch (Exception)
			{
				throw;
			}
			return result;
		}

		public bool LoadFile(string sNodeName, string sFilepath)
		{
			bool result = true;
			try
			{
				XmlDocument xmlDocument = new XmlDocument();
				xmlDocument.Load(sFilepath);
				XmlNode nodeBySpecifyStdId = this.GetNodeBySpecifyStdId("08BJ7-1", xmlDocument);
				if (nodeBySpecifyStdId != null)
				{
					for (XmlNode xmlNode = nodeBySpecifyStdId.FirstChild; xmlNode != null; xmlNode = xmlNode.NextSibling)
					{
						StairArchStdBuildingType buildType = (StairArchStdBuildingType)Convert.ToInt32(xmlNode.Attributes["id"].Value);
						switch (buildType)
						{
						case StairArchStdBuildingType.SASBT_Residence:
							StairArchStd.m_ListCheckData.Add(this.ReadResidenceXmlData(xmlNode, buildType));
							break;
						case StairArchStdBuildingType.SASBT_Kindergarten:
							StairArchStd.m_ListCheckData.Add(this.ReadKindergartenXmlData(xmlNode, buildType));
							break;
						case StairArchStdBuildingType.SASBT_MidLittleSchool:
							StairArchStd.m_ListCheckData.Add(this.ReadMidLittleSchoolXmlData(xmlNode, buildType));
							break;
						case StairArchStdBuildingType.SASBT_Shop:
							StairArchStd.m_ListCheckData.Add(this.ReadShopXmlData(xmlNode, buildType));
							break;
						case StairArchStdBuildingType.SASBT_Hospital:
							StairArchStd.m_ListCheckData.Add(this.ReadHospitalXmlData(xmlNode, buildType));
							break;
						case StairArchStdBuildingType.SASBT_OldPeopleBuilding:
							StairArchStd.m_ListCheckData.Add(this.ReadOldPeopleBuildingXmlData(xmlNode, buildType));
							break;
						}
					}
				}
			}
			catch (Exception ex)
			{
				ex.ToString();
				result = false;
			}
			return result;
		}

		private string BuildTypeToStringName(StairArchStdBuildingType type)
		{
			string result = null;
			switch (type)
			{
			case StairArchStdBuildingType.SASBT_Residence:
				result = "住宅";
				break;
			case StairArchStdBuildingType.SASBT_Kindergarten:
				result = "托儿所、幼儿园";
				break;
			case StairArchStdBuildingType.SASBT_MidLittleSchool:
				result = "中、小学";
				break;
			case StairArchStdBuildingType.SASBT_Shop:
				result = "商店";
				break;
			case StairArchStdBuildingType.SASBT_Hospital:
				result = "综合医院";
				break;
			case StairArchStdBuildingType.SASBT_OldPeopleBuilding:
				result = "老年人建筑";
				break;
			}
			return result;
		}

		private string StairLimitTypeToStringName(StairArchStdLimitConditionType type)
		{
			string result = null;
			switch (type)
			{
			case StairArchStdLimitConditionType.SASLCT_PublicStair:
				result = "公共楼梯";
				break;
			case StairArchStdLimitConditionType.SASLCT_IndoorStair:
				result = "户内楼梯";
				break;
			case StairArchStdLimitConditionType.SASLCT_SpecialEmergencyStair:
				result = "专用疏散楼梯";
				break;
			case StairArchStdLimitConditionType.SASLCT_OtherBuildStair:
				result = "其它建筑楼梯";
				break;
			case StairArchStdLimitConditionType.SASLCT_ChildStair:
				result = "幼儿用楼梯";
				break;
			case StairArchStdLimitConditionType.SASLCT_SchoolStair:
				result = "教学楼楼梯";
				break;
			case StairArchStdLimitConditionType.SASLCT_BusinessPublicStair:
				result = "营业部分公共楼梯";
				break;
			case StairArchStdLimitConditionType.SASLCT_SickroomStair:
				result = "门诊、急诊、病房楼";
				break;
			case StairArchStdLimitConditionType.SASLCT_BeadhouseStair:
				result = "老年住宅、老年公寓养老院、托老所";
				break;
			}
			return result;
		}

		private string BuildTypeToStringId(StairArchStdBuildingType type)
		{
			int num = (int)type;
			return num.ToString();
		}

		private string StairLimitTypeToStringId(StairArchStdLimitConditionType type)
		{
			int num = (int)type;
			return num.ToString();
		}

		private StairArchStd.ResidenceXmlData AnalysisResidenceXmlData(StairArchStdData stdData)
		{
			StairArchStd.ResidenceXmlData residenceXmlData = new StairArchStd.ResidenceXmlData();
			if (stdData != null)
			{
				residenceXmlData.name = this.BuildTypeToStringName(stdData.m_StairArchStdBuildType);
				residenceXmlData.id = this.BuildTypeToStringId(stdData.m_StairArchStdBuildType);
				foreach (BaseStairArchStdLimitCondition baseStairArchStdLimitCondition in stdData.m_ListStairArchStdCondition)
				{
					if (baseStairArchStdLimitCondition.m_StairArchStdLimitType == StairArchStdLimitConditionType.SASLCT_IndoorStair)
					{
						residenceXmlData.IndoorStairName = this.StairLimitTypeToStringName(baseStairArchStdLimitCondition.m_StairArchStdLimitType);
						residenceXmlData.IndoorStairId = this.StairLimitTypeToStringId(baseStairArchStdLimitCondition.m_StairArchStdLimitType);
						ResidenceIndoorStairArchStdLadderData residenceIndoorStairArchStdLadderData = baseStairArchStdLimitCondition.m_StairArchStdLadderData as ResidenceIndoorStairArchStdLadderData;
						if (residenceIndoorStairArchStdLadderData != null)
						{
							residenceXmlData.NearSpaceWidth = residenceIndoorStairArchStdLadderData.m_dStairArchStdLadderNearSpaceWidth.ToString("f0");
							residenceXmlData.TwoSideWidth = residenceIndoorStairArchStdLadderData.m_dStairArchStdLadderTwoSideWidth.ToString("f0");
							residenceXmlData.IndoorTreadHight = residenceIndoorStairArchStdLadderData.m_dStairArchStdTreadHeight.ToString("f0");
							residenceXmlData.IndoorTreadWidth = residenceIndoorStairArchStdLadderData.m_dStairArchStdTreadWidth.ToString("f0");
						}
					}
					else if (baseStairArchStdLimitCondition.m_StairArchStdLimitType == StairArchStdLimitConditionType.SASLCT_PublicStair)
					{
						residenceXmlData.PublicStairName = this.StairLimitTypeToStringName(baseStairArchStdLimitCondition.m_StairArchStdLimitType);
						residenceXmlData.PublicStairId = this.StairLimitTypeToStringId(baseStairArchStdLimitCondition.m_StairArchStdLimitType);
						ResidencePubicStairArchStdLadderData residencePubicStairArchStdLadderData = baseStairArchStdLimitCondition.m_StairArchStdLadderData as ResidencePubicStairArchStdLadderData;
						if (residencePubicStairArchStdLadderData != null)
						{
							residenceXmlData.StairSevenWidth = residencePubicStairArchStdLadderData.m_dStairArchStdLadderSevenWidth.ToString("f0");
							residenceXmlData.StairSixWidth = residencePubicStairArchStdLadderData.m_dStairArchStdLadderSixWidth.ToString("f0");
							residenceXmlData.PublicTreadHight = residencePubicStairArchStdLadderData.m_dStairArchStdTreadHeight.ToString("f0");
							residenceXmlData.PublicTreadWidth = residencePubicStairArchStdLadderData.m_dStairArchStdTreadWidth.ToString("f0");
						}
					}
					else if (baseStairArchStdLimitCondition.m_StairArchStdLimitType == StairArchStdLimitConditionType.SASLCT_SpecialEmergencyStair)
					{
						residenceXmlData.SpecialEmergencyStairName = this.StairLimitTypeToStringName(baseStairArchStdLimitCondition.m_StairArchStdLimitType);
						residenceXmlData.SpecialEmergencyStairId = this.StairLimitTypeToStringId(baseStairArchStdLimitCondition.m_StairArchStdLimitType);
						BaseStairArchStdLadderData stairArchStdLadderData = baseStairArchStdLimitCondition.m_StairArchStdLadderData;
						if (stairArchStdLadderData != null)
						{
							residenceXmlData.SpecialTreadHight = stairArchStdLadderData.m_dStairArchStdTreadHeight.ToString("f0");
							residenceXmlData.SpecialTreadWidth = stairArchStdLadderData.m_dStairArchStdTreadWidth.ToString("f0");
						}
					}
					else if (baseStairArchStdLimitCondition.m_StairArchStdLimitType == StairArchStdLimitConditionType.SASLCT_OtherBuildStair)
					{
						residenceXmlData.OtherBuildStairName = this.StairLimitTypeToStringName(baseStairArchStdLimitCondition.m_StairArchStdLimitType);
						residenceXmlData.OtherBuildStairId = this.StairLimitTypeToStringId(baseStairArchStdLimitCondition.m_StairArchStdLimitType);
						BaseStairArchStdLadderData stairArchStdLadderData2 = baseStairArchStdLimitCondition.m_StairArchStdLadderData;
						if (stairArchStdLadderData2 != null)
						{
							residenceXmlData.OtherTreadHight = stairArchStdLadderData2.m_dStairArchStdTreadHeight.ToString("f0");
							residenceXmlData.OtherTreadWidth = stairArchStdLadderData2.m_dStairArchStdTreadWidth.ToString("f0");
						}
					}
				}
				if (stdData.m_StairArchStdRailData is ResidenceStairArchStdRailData)
				{
					ResidenceStairArchStdRailData residenceStairArchStdRailData = stdData.m_StairArchStdRailData as ResidenceStairArchStdRailData;
					residenceXmlData.RailHight = residenceStairArchStdRailData.m_dStairArchStdRailHight.ToString("f0");
					residenceXmlData.RailSpace = residenceStairArchStdRailData.m_dStairArchStdRailSpace.ToString("f0");
					residenceXmlData.RailHorizontalLength = residenceStairArchStdRailData.m_dStairArchStdRailHorizontalLength.ToString("f0");
					residenceXmlData.RailHorizontalHight = residenceStairArchStdRailData.m_dStairArchStdRailHorizontalHight.ToString("f0");
				}
				residenceXmlData.LandWidth = stdData.m_StairArchStdLandData.m_dStairArchStdLandWidth.ToString("f0");
				residenceXmlData.Mark = stdData.m_sStairArchStdReMark;
			}
			return residenceXmlData;
		}

		private StairArchStd.KindergartenXmlData AnalysisKindergartenXmlData(StairArchStdData stdData)
		{
			StairArchStd.KindergartenXmlData kindergartenXmlData = new StairArchStd.KindergartenXmlData();
			if (stdData != null)
			{
				kindergartenXmlData.name = this.BuildTypeToStringName(stdData.m_StairArchStdBuildType);
				kindergartenXmlData.id = this.BuildTypeToStringId(stdData.m_StairArchStdBuildType);
				foreach (BaseStairArchStdLimitCondition baseStairArchStdLimitCondition in stdData.m_ListStairArchStdCondition)
				{
					if (baseStairArchStdLimitCondition.m_StairArchStdLimitType == StairArchStdLimitConditionType.SASLCT_ChildStair)
					{
						kindergartenXmlData.StairName = this.StairLimitTypeToStringName(baseStairArchStdLimitCondition.m_StairArchStdLimitType);
						kindergartenXmlData.StairId = this.StairLimitTypeToStringId(baseStairArchStdLimitCondition.m_StairArchStdLimitType);
						kindergartenXmlData.TreadHight = baseStairArchStdLimitCondition.m_StairArchStdLadderData.m_dStairArchStdTreadHeight.ToString("f0");
						kindergartenXmlData.TreadWidth = baseStairArchStdLimitCondition.m_StairArchStdLadderData.m_dStairArchStdTreadWidth.ToString("f0");
						break;
					}
				}
				kindergartenXmlData.RailHight = stdData.m_StairArchStdRailData.m_dStairArchStdRailHight.ToString("f0");
				kindergartenXmlData.RailSpace = stdData.m_StairArchStdRailData.m_dStairArchStdRailSpace.ToString("f0");
				kindergartenXmlData.Mark = stdData.m_sStairArchStdReMark;
			}
			return kindergartenXmlData;
		}

		private StairArchStd.MidLittleSchoolXmlData AnalysisMidLittleSchoolXmlData(StairArchStdData stdData)
		{
			StairArchStd.MidLittleSchoolXmlData midLittleSchoolXmlData = new StairArchStd.MidLittleSchoolXmlData();
			if (stdData != null)
			{
				midLittleSchoolXmlData.name = this.BuildTypeToStringName(stdData.m_StairArchStdBuildType);
				midLittleSchoolXmlData.id = this.BuildTypeToStringId(stdData.m_StairArchStdBuildType);
				foreach (BaseStairArchStdLimitCondition baseStairArchStdLimitCondition in stdData.m_ListStairArchStdCondition)
				{
					if (baseStairArchStdLimitCondition.m_StairArchStdLimitType == StairArchStdLimitConditionType.SASLCT_SchoolStair)
					{
						midLittleSchoolXmlData.StairName = this.StairLimitTypeToStringName(baseStairArchStdLimitCondition.m_StairArchStdLimitType);
						midLittleSchoolXmlData.StairId = this.StairLimitTypeToStringId(baseStairArchStdLimitCondition.m_StairArchStdLimitType);
						SchoolStairArchStdLadderData schoolStairArchStdLadderData = baseStairArchStdLimitCondition.m_StairArchStdLadderData as SchoolStairArchStdLadderData;
						midLittleSchoolXmlData.StairSpaceWidth = schoolStairArchStdLadderData.m_dStairArchStdLadderWidth.ToString("f0");
						midLittleSchoolXmlData.StairSlope = schoolStairArchStdLadderData.m_dStairArchStdSlope.ToString("f0");
						break;
					}
				}
				if (stdData.m_StairArchStdRailData is SchoolStairArchStdRailData)
				{
					SchoolStairArchStdRailData schoolStairArchStdRailData = stdData.m_StairArchStdRailData as SchoolStairArchStdRailData;
					midLittleSchoolXmlData.RailIndoorHight = schoolStairArchStdRailData.m_dStairArchStdIndoorRailHight.ToString("f0");
					midLittleSchoolXmlData.RailOutdoorHight = schoolStairArchStdRailData.m_dStairArchStdOutdoorRailHight.ToString("f0");
					midLittleSchoolXmlData.RailSpace = schoolStairArchStdRailData.m_dStairArchStdRailSpace.ToString("f0");
					midLittleSchoolXmlData.RailHorizontalLength = schoolStairArchStdRailData.m_dStairArchStdRailHorizontalLength.ToString("f0");
					midLittleSchoolXmlData.RailHorizontalHight = schoolStairArchStdRailData.m_dStairArchStdRailHorizontalHight.ToString("f0");
				}
				midLittleSchoolXmlData.Mark = stdData.m_sStairArchStdReMark;
			}
			return midLittleSchoolXmlData;
		}

		private StairArchStd.ShopXmlData AnalysisShopXmlData(StairArchStdData stdData)
		{
			StairArchStd.ShopXmlData shopXmlData = new StairArchStd.ShopXmlData();
			if (stdData != null)
			{
				shopXmlData.name = this.BuildTypeToStringName(stdData.m_StairArchStdBuildType);
				shopXmlData.id = this.BuildTypeToStringId(stdData.m_StairArchStdBuildType);
				foreach (BaseStairArchStdLimitCondition baseStairArchStdLimitCondition in stdData.m_ListStairArchStdCondition)
				{
					if (baseStairArchStdLimitCondition.m_StairArchStdLimitType == StairArchStdLimitConditionType.SASLCT_BusinessPublicStair)
					{
						shopXmlData.StairName = this.StairLimitTypeToStringName(baseStairArchStdLimitCondition.m_StairArchStdLimitType);
						shopXmlData.StairId = this.StairLimitTypeToStringId(baseStairArchStdLimitCondition.m_StairArchStdLimitType);
						BaseStairArchStdLadderData stairArchStdLadderData = baseStairArchStdLimitCondition.m_StairArchStdLadderData;
						shopXmlData.StairSpaceWidth = stairArchStdLadderData.m_dStairArchStdLadderWidth.ToString("f0");
						shopXmlData.TreadHight = stairArchStdLadderData.m_dStairArchStdTreadHeight.ToString("f0");
						shopXmlData.TreadWidth = stairArchStdLadderData.m_dStairArchStdTreadWidth.ToString("f0");
						break;
					}
				}
				if (stdData.m_StairArchStdRailData is ShopStairArchStdRailData)
				{
					ShopStairArchStdRailData shopStairArchStdRailData = stdData.m_StairArchStdRailData as ShopStairArchStdRailData;
					shopXmlData.RailIndoorHight = shopStairArchStdRailData.m_dStairArchStdIndoorRailHight.ToString("f0");
					shopXmlData.RailOutdoorHight = shopStairArchStdRailData.m_dStairArchStdOutdoorRailHight.ToString("f0");
				}
				shopXmlData.Mark = stdData.m_sStairArchStdReMark;
			}
			return shopXmlData;
		}

		private StairArchStd.HospitalXmlData AnalysisHospitalXmlData(StairArchStdData stdData)
		{
			StairArchStd.HospitalXmlData hospitalXmlData = new StairArchStd.HospitalXmlData();
			if (stdData != null)
			{
				hospitalXmlData.name = this.BuildTypeToStringName(stdData.m_StairArchStdBuildType);
				hospitalXmlData.id = this.BuildTypeToStringId(stdData.m_StairArchStdBuildType);
				foreach (BaseStairArchStdLimitCondition baseStairArchStdLimitCondition in stdData.m_ListStairArchStdCondition)
				{
					if (baseStairArchStdLimitCondition.m_StairArchStdLimitType == StairArchStdLimitConditionType.SASLCT_SickroomStair)
					{
						hospitalXmlData.StairName = this.StairLimitTypeToStringName(baseStairArchStdLimitCondition.m_StairArchStdLimitType);
						hospitalXmlData.StairId = this.StairLimitTypeToStringId(baseStairArchStdLimitCondition.m_StairArchStdLimitType);
						BaseStairArchStdLadderData stairArchStdLadderData = baseStairArchStdLimitCondition.m_StairArchStdLadderData;
						hospitalXmlData.StairSpaceWidth = stairArchStdLadderData.m_dStairArchStdLadderWidth.ToString("f0");
						hospitalXmlData.TreadHight = stairArchStdLadderData.m_dStairArchStdTreadHeight.ToString("f0");
						hospitalXmlData.TreadWidth = stairArchStdLadderData.m_dStairArchStdTreadWidth.ToString("f0");
						break;
					}
				}
				hospitalXmlData.LandWidth = stdData.m_StairArchStdLandData.m_dStairArchStdLandWidth.ToString("f0");
				hospitalXmlData.Mark = stdData.m_sStairArchStdReMark;
			}
			return hospitalXmlData;
		}

		private StairArchStd.OldPeopleBuildingXmlData AnalysisOldPeopleBuildingXmlData(StairArchStdData stdData)
		{
			StairArchStd.OldPeopleBuildingXmlData oldPeopleBuildingXmlData = new StairArchStd.OldPeopleBuildingXmlData();
			if (stdData != null)
			{
				oldPeopleBuildingXmlData.name = this.BuildTypeToStringName(stdData.m_StairArchStdBuildType);
				oldPeopleBuildingXmlData.id = this.BuildTypeToStringId(stdData.m_StairArchStdBuildType);
				foreach (BaseStairArchStdLimitCondition baseStairArchStdLimitCondition in stdData.m_ListStairArchStdCondition)
				{
					if (baseStairArchStdLimitCondition.m_StairArchStdLimitType == StairArchStdLimitConditionType.SASLCT_BeadhouseStair)
					{
						oldPeopleBuildingXmlData.StairName = this.StairLimitTypeToStringName(baseStairArchStdLimitCondition.m_StairArchStdLimitType);
						oldPeopleBuildingXmlData.StairId = this.StairLimitTypeToStringId(baseStairArchStdLimitCondition.m_StairArchStdLimitType);
						OldStairArchStdLadderData oldStairArchStdLadderData = baseStairArchStdLimitCondition.m_StairArchStdLadderData as OldStairArchStdLadderData;
						oldPeopleBuildingXmlData.StairSpaceWidth = oldStairArchStdLadderData.m_dStairArchStdLadderWidth.ToString("f0");
						oldPeopleBuildingXmlData.HomeTreadHight = oldStairArchStdLadderData.m_dStairArchStdTreadHomeHeight.ToString("f0");
						oldPeopleBuildingXmlData.HomeTreadWidth = oldStairArchStdLadderData.m_dStairArchStdTreadHomeWidth.ToString("f0");
						oldPeopleBuildingXmlData.PublicTreadHight = oldStairArchStdLadderData.m_dStairArchStdTreadPublicHeight.ToString("f0");
						oldPeopleBuildingXmlData.PublicTreadWidth = oldStairArchStdLadderData.m_dStairArchStdTreadPublicWidth.ToString("f0");
						break;
					}
				}
				oldPeopleBuildingXmlData.Mark = stdData.m_sStairArchStdReMark;
			}
			return oldPeopleBuildingXmlData;
		}

		private XmlNode CreateStdTypeChildeNode(string strValue, string sNodeName, XmlDocument xmlDoc)
		{
			XmlElement xmlElement = xmlDoc.CreateElement(sNodeName);
			xmlElement.InnerText = strValue;
			return xmlElement;
		}

		private void WriteResidenceXmlData(ref XmlNode StdRootNode, StairArchStdData stdData, XmlDocument xmlDoc)
		{
			if (stdData != null)
			{
				StairArchStd.ResidenceXmlData residenceXmlData = this.AnalysisResidenceXmlData(stdData);
				XmlNode xmlNode = xmlDoc.CreateElement("StdType");
				XmlAttribute xmlAttribute = xmlDoc.CreateAttribute("name");
				xmlAttribute.Value = residenceXmlData.name;
				XmlAttribute xmlAttribute2 = xmlDoc.CreateAttribute("id");
				xmlAttribute2.Value = residenceXmlData.id;
				xmlNode.Attributes.SetNamedItem(xmlAttribute);
				xmlNode.Attributes.SetNamedItem(xmlAttribute2);
				XmlNode xmlNode2 = StdRootNode.AppendChild(xmlNode);
				if (xmlNode2 != null)
				{
					int num = 0;
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.PublicStairName, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.PublicStairId, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.StairSevenWidth, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.StairSixWidth, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.PublicTreadHight, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.PublicTreadWidth, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.IndoorStairName, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.IndoorStairId, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.NearSpaceWidth, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.TwoSideWidth, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.IndoorTreadHight, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.IndoorTreadWidth, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.SpecialEmergencyStairName, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.SpecialEmergencyStairId, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.SpecialTreadHight, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.SpecialTreadWidth, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.OtherBuildStairName, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.OtherBuildStairId, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.OtherTreadHight, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.OtherTreadWidth, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.RailHight, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.RailSpace, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.LandWidth, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.RailHorizontalLength, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.RailHorizontalHight, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
					xmlNode2.AppendChild(this.CreateStdTypeChildeNode(residenceXmlData.Mark, residenceXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				}
			}
		}

		private void WriteKindergartenXmlData(ref XmlNode StdRootNode, StairArchStdData stdData, XmlDocument xmlDoc)
		{
			StairArchStd.KindergartenXmlData kindergartenXmlData = this.AnalysisKindergartenXmlData(stdData);
			XmlNode xmlNode = xmlDoc.CreateElement("StdType");
			XmlAttribute xmlAttribute = xmlDoc.CreateAttribute("name");
			xmlAttribute.Value = kindergartenXmlData.name;
			XmlAttribute xmlAttribute2 = xmlDoc.CreateAttribute("id");
			xmlAttribute2.Value = kindergartenXmlData.id;
			xmlNode.Attributes.SetNamedItem(xmlAttribute);
			xmlNode.Attributes.SetNamedItem(xmlAttribute2);
			XmlNode xmlNode2 = StdRootNode.AppendChild(xmlNode);
			if (xmlNode2 != null)
			{
				int num = 0;
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(kindergartenXmlData.StairName, kindergartenXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(kindergartenXmlData.StairId, kindergartenXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(kindergartenXmlData.TreadHight, kindergartenXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(kindergartenXmlData.TreadWidth, kindergartenXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(kindergartenXmlData.RailHight, kindergartenXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(kindergartenXmlData.RailSpace, kindergartenXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(kindergartenXmlData.Mark, kindergartenXmlData.GetType().GetFields()[num++].Name, xmlDoc));
			}
		}

		private void WriteMidLittleSchoolXmlData(ref XmlNode StdRootNode, StairArchStdData stdData, XmlDocument xmlDoc)
		{
			StairArchStd.MidLittleSchoolXmlData midLittleSchoolXmlData = this.AnalysisMidLittleSchoolXmlData(stdData);
			XmlNode xmlNode = xmlDoc.CreateElement("StdType");
			XmlAttribute xmlAttribute = xmlDoc.CreateAttribute("name");
			xmlAttribute.Value = midLittleSchoolXmlData.name;
			XmlAttribute xmlAttribute2 = xmlDoc.CreateAttribute("id");
			xmlAttribute2.Value = midLittleSchoolXmlData.id;
			xmlNode.Attributes.SetNamedItem(xmlAttribute);
			xmlNode.Attributes.SetNamedItem(xmlAttribute2);
			XmlNode xmlNode2 = StdRootNode.AppendChild(xmlNode);
			if (xmlNode2 != null)
			{
				int num = 0;
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(midLittleSchoolXmlData.StairName, midLittleSchoolXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(midLittleSchoolXmlData.StairId, midLittleSchoolXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(midLittleSchoolXmlData.StairSpaceWidth, midLittleSchoolXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(midLittleSchoolXmlData.StairSlope, midLittleSchoolXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(midLittleSchoolXmlData.RailIndoorHight, midLittleSchoolXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(midLittleSchoolXmlData.RailOutdoorHight, midLittleSchoolXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(midLittleSchoolXmlData.RailSpace, midLittleSchoolXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(midLittleSchoolXmlData.RailHorizontalLength, midLittleSchoolXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(midLittleSchoolXmlData.RailHorizontalHight, midLittleSchoolXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(midLittleSchoolXmlData.Mark, midLittleSchoolXmlData.GetType().GetFields()[num++].Name, xmlDoc));
			}
		}

		private void WriteShopXmlData(ref XmlNode StdRootNode, StairArchStdData stdData, XmlDocument xmlDoc)
		{
			StairArchStd.ShopXmlData shopXmlData = this.AnalysisShopXmlData(stdData);
			XmlNode xmlNode = xmlDoc.CreateElement("StdType");
			XmlAttribute xmlAttribute = xmlDoc.CreateAttribute("name");
			xmlAttribute.Value = shopXmlData.name;
			XmlAttribute xmlAttribute2 = xmlDoc.CreateAttribute("id");
			xmlAttribute2.Value = shopXmlData.id;
			xmlNode.Attributes.SetNamedItem(xmlAttribute);
			xmlNode.Attributes.SetNamedItem(xmlAttribute2);
			XmlNode xmlNode2 = StdRootNode.AppendChild(xmlNode);
			if (xmlNode2 != null)
			{
				int num = 0;
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(shopXmlData.StairName, shopXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(shopXmlData.StairId, shopXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(shopXmlData.StairSpaceWidth, shopXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(shopXmlData.TreadHight, shopXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(shopXmlData.TreadWidth, shopXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(shopXmlData.RailIndoorHight, shopXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(shopXmlData.RailOutdoorHight, shopXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(shopXmlData.Mark, shopXmlData.GetType().GetFields()[num++].Name, xmlDoc));
			}
		}

		private void WriteHospitalXmlData(ref XmlNode StdRootNode, StairArchStdData stdData, XmlDocument xmlDoc)
		{
			StairArchStd.HospitalXmlData hospitalXmlData = this.AnalysisHospitalXmlData(stdData);
			XmlNode xmlNode = xmlDoc.CreateElement("StdType");
			XmlAttribute xmlAttribute = xmlDoc.CreateAttribute("name");
			xmlAttribute.Value = hospitalXmlData.name;
			XmlAttribute xmlAttribute2 = xmlDoc.CreateAttribute("id");
			xmlAttribute2.Value = hospitalXmlData.id;
			xmlNode.Attributes.SetNamedItem(xmlAttribute);
			xmlNode.Attributes.SetNamedItem(xmlAttribute2);
			XmlNode xmlNode2 = StdRootNode.AppendChild(xmlNode);
			if (xmlNode2 != null)
			{
				int num = 0;
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(hospitalXmlData.StairName, hospitalXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(hospitalXmlData.StairId, hospitalXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(hospitalXmlData.StairSpaceWidth, hospitalXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(hospitalXmlData.TreadHight, hospitalXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(hospitalXmlData.TreadWidth, hospitalXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(hospitalXmlData.LandWidth, hospitalXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(hospitalXmlData.Mark, hospitalXmlData.GetType().GetFields()[num++].Name, xmlDoc));
			}
		}

		private void WriteOldPeopleBuildingXmlData(ref XmlNode StdRootNode, StairArchStdData stdData, XmlDocument xmlDoc)
		{
			StairArchStd.OldPeopleBuildingXmlData oldPeopleBuildingXmlData = this.AnalysisOldPeopleBuildingXmlData(stdData);
			XmlNode xmlNode = xmlDoc.CreateElement("StdType");
			XmlAttribute xmlAttribute = xmlDoc.CreateAttribute("name");
			xmlAttribute.Value = oldPeopleBuildingXmlData.name;
			XmlAttribute xmlAttribute2 = xmlDoc.CreateAttribute("id");
			xmlAttribute2.Value = oldPeopleBuildingXmlData.id;
			xmlNode.Attributes.SetNamedItem(xmlAttribute);
			xmlNode.Attributes.SetNamedItem(xmlAttribute2);
			XmlNode xmlNode2 = StdRootNode.AppendChild(xmlNode);
			if (xmlNode2 != null)
			{
				int num = 0;
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(oldPeopleBuildingXmlData.StairName, oldPeopleBuildingXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(oldPeopleBuildingXmlData.StairId, oldPeopleBuildingXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(oldPeopleBuildingXmlData.StairSpaceWidth, oldPeopleBuildingXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(oldPeopleBuildingXmlData.HomeTreadHight, oldPeopleBuildingXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(oldPeopleBuildingXmlData.HomeTreadWidth, oldPeopleBuildingXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(oldPeopleBuildingXmlData.PublicTreadHight, oldPeopleBuildingXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(oldPeopleBuildingXmlData.PublicTreadWidth, oldPeopleBuildingXmlData.GetType().GetFields()[num++].Name, xmlDoc));
				xmlNode2.AppendChild(this.CreateStdTypeChildeNode(oldPeopleBuildingXmlData.Mark, oldPeopleBuildingXmlData.GetType().GetFields()[num++].Name, xmlDoc));
			}
		}

		public bool WriteFile(string sNodeName, string sFilepath)
		{
			bool result = false;
			try
			{
				XmlDocument xmlDocument = new XmlDocument();
				xmlDocument.Load(sFilepath);
				XmlNode xmlNode = this.GetNodeBySpecifyStdId(sNodeName, xmlDocument);
				if (xmlNode == null)
				{
					xmlNode = xmlDocument.CreateElement("Std");
					if (xmlNode != null)
					{
						XmlAttribute xmlAttribute = xmlDocument.CreateAttribute("id");
						xmlAttribute.Value = "08BJ7-1";
						xmlNode.Attributes.SetNamedItem(xmlAttribute);
						foreach (StairArchStdData stairArchStdData in StairArchStd.m_ListCheckData)
						{
							switch (stairArchStdData.m_StairArchStdBuildType)
							{
							case StairArchStdBuildingType.SASBT_Residence:
								this.WriteResidenceXmlData(ref xmlNode, stairArchStdData, xmlDocument);
								break;
							case StairArchStdBuildingType.SASBT_Kindergarten:
								this.WriteKindergartenXmlData(ref xmlNode, stairArchStdData, xmlDocument);
								break;
							case StairArchStdBuildingType.SASBT_MidLittleSchool:
								this.WriteMidLittleSchoolXmlData(ref xmlNode, stairArchStdData, xmlDocument);
								break;
							case StairArchStdBuildingType.SASBT_Shop:
								this.WriteShopXmlData(ref xmlNode, stairArchStdData, xmlDocument);
								break;
							case StairArchStdBuildingType.SASBT_Hospital:
								this.WriteHospitalXmlData(ref xmlNode, stairArchStdData, xmlDocument);
								break;
							case StairArchStdBuildingType.SASBT_OldPeopleBuilding:
								this.WriteOldPeopleBuildingXmlData(ref xmlNode, stairArchStdData, xmlDocument);
								break;
							}
						}
						xmlDocument.DocumentElement.AppendChild(xmlNode);
						xmlDocument.Save(sFilepath);
						result = true;
					}
				}
			}
			catch (Exception ex)
			{
				ex.ToString();
			}
			return result;
		}

		private string CreateStrMsgNew(string sCheckTypeName, string sCheckValueName, string sCheckValue, string strBookName)
		{
			return string.Concat(new string[]
			{
				"参数值不满足",
				strBookName,
				sCheckTypeName,
				sCheckValueName,
				sCheckValue
			});
		}

		private string CreateStrMsg(string sStdName, string sCheckTypeName, string sCheckValueName, string sCheckValue, bool bSpecification = false, string sTerms = "")
		{
			string result;
			if (bSpecification)
			{
				result = "参数值不满足《民用建筑设计通则》" + sCheckTypeName + sCheckValueName + sCheckValue;
			}
			else
			{
				result = string.Concat(new string[]
				{
					"值不满足《楼梯》",
					sStdName,
					"中",
					sCheckTypeName,
					sCheckValueName,
					sCheckValue
				});
			}
			return result;
		}

		private StairArchStdData GetCheckDataByBuildType(StairArchStdBuildingType buildType)
		{
			StairArchStdData result = null;
			foreach (StairArchStdData stairArchStdData in StairArchStd.m_ListCheckData)
			{
				if (stairArchStdData.m_StairArchStdBuildType == buildType)
				{
					result = stairArchStdData;
					break;
				}
			}
			return result;
		}

		private BaseStairArchStdLimitCondition GetLimitConditionByLimitType(StairArchStdBuildingType buildType, StairArchStdLimitConditionType limitType, ref string sArchStdName)
		{
			BaseStairArchStdLimitCondition result = null;
			StairArchStdData checkDataByBuildType = this.GetCheckDataByBuildType(buildType);
			sArchStdName = checkDataByBuildType.m_sArchStdName;
			foreach (BaseStairArchStdLimitCondition baseStairArchStdLimitCondition in checkDataByBuildType.m_ListStairArchStdCondition)
			{
				if (baseStairArchStdLimitCondition.m_StairArchStdLimitType == limitType)
				{
					result = baseStairArchStdLimitCondition;
					break;
				}
			}
			return result;
		}

		public bool CheckStairTreadDepth(string strUsingRange, double dTreadDepth, ref string sMsg)
		{
			bool result = true;
			double dStairArchStdTreadDepth = StairArchStd.m_DicCheckRunData[strUsingRange].m_dStairArchStdTreadDepth;
			if (dTreadDepth < dStairArchStdTreadDepth)
			{
				result = false;
				sMsg = this.CreateStrMsgNew("踏步宽度", "大于等于", dStairArchStdTreadDepth.ToString("f0"), "《民用设计通则》");
			}
			return result;
		}

		public bool CheckStairTreadHeight(string strUsingRange, double dTreadHeight, ref string sMsg)
		{
			bool result = true;
			double dStairArchStdTreadHeight = StairArchStd.m_DicCheckRunData[strUsingRange].m_dStairArchStdTreadHeight;
			if (dTreadHeight > dStairArchStdTreadHeight)
			{
				result = false;
				sMsg = this.CreateStrMsgNew("踏步高度", "小于等于", dStairArchStdTreadHeight.ToString("f0"), "《民用设计通则》");
			}
			return result;
		}

		public bool CheckStairsRunWidth(string strUsingRange, double runWidth, ref string sMsg)
		{
			bool result = true;
			double dStairArchStdLadderWidth = StairArchStd.m_DicCheckRunData[strUsingRange].m_dStairArchStdLadderWidth;
			if (runWidth < dStairArchStdLadderWidth)
			{
				result = false;
				sMsg = this.CreateStrMsgNew("梯段净宽", "大于等于", dStairArchStdLadderWidth.ToString("f0"), "《民用设计通则》");
			}
			return result;
		}

		public bool CheckStairsLandWidth(string strUsingRange, double LandWidth, double runWidth, ref string sMsg)
		{
			bool result = true;
			double dStairArchStdLandWidth = StairArchStd.m_DicCheckLandData[strUsingRange].m_dStairArchStdLandWidth;
			if (dStairArchStdLandWidth < 0.0001)
			{
				if (LandWidth < runWidth)
				{
					result = false;
					sMsg = "休息平台宽度参数值不满足国家建筑标准设计图集中平台宽度大于等于梯段宽度的限定";
				}
			}
			else if (LandWidth < dStairArchStdLandWidth || LandWidth < runWidth)
			{
				result = false;
				if (runWidth < 0.0001)
				{
					sMsg = this.CreateStrMsgNew("平台净宽", "大于等于", dStairArchStdLandWidth.ToString("f0"), "国家建筑标准设计图集");
				}
				else
				{
					sMsg = this.CreateStrMsgNew("平台净宽", "大于等于梯段宽度大于等于", dStairArchStdLandWidth.ToString("f0"), "国家建筑标准设计图集");
				}
			}
			return result;
		}

		public bool CheckStairsSingleRunTreadNum(double TreadNum, ref string sMsg)
		{
			bool result = true;
			if (TreadNum < 3.0 || TreadNum > 18.0)
			{
				result = false;
				sMsg = "单个梯段的踏步个数参数值不满足《民用建筑设计通则》每个梯段的踏步不应超过18级，亦不小于3级";
			}
			return result;
		}

		public bool CheckStairLandHeight(string strUsingRange, double dLandHeight, ref string sMsg, int iflg = 0)
		{
			bool result = true;
			double dStairArchStdLandHeightMin = StairArchStd.m_ClearHeightData.m_dStairArchStdLandHeightMin;
			if (1 == iflg)
			{
				dStairArchStdLandHeightMin = StairArchStd.m_ClearHeightData.m_dStairArchStdLandHeightMin;
			}
			if (dLandHeight < dStairArchStdLandHeightMin)
			{
				result = false;
				sMsg = this.CreateStrMsg(strUsingRange, "平台净高", "大于等于", dStairArchStdLandHeightMin.ToString("f0"), false, "");
			}
			else
			{
				sMsg = "OK";
			}
			return result;
		}

		public bool CheckStairLadderHeight(string strUsingRange, double dLadderHeight, ref string sMsg)
		{
			bool result = true;
			if (dLadderHeight < StairArchStd.m_ClearHeightData.m_dStairArchStdLadderHeight)
			{
				result = false;
				sMsg = this.CreateStrMsg(strUsingRange, "梯段净高", "大于等于", StairArchStd.m_ClearHeightData.m_dStairArchStdLadderHeight.ToString("f0"), false, "");
			}
			else
			{
				sMsg = "OK";
			}
			return result;
		}

		public bool CheckStairRailHeight(StairArchStdBuildingType buildType, double dHeight, ref string sMsg)
		{
			bool result = true;
			StairArchStdData checkDataByBuildType = this.GetCheckDataByBuildType(buildType);
			switch (buildType)
			{
			case StairArchStdBuildingType.SASBT_Residence:
				if (checkDataByBuildType != null)
				{
					if (dHeight < checkDataByBuildType.m_StairArchStdRailData.m_dStairArchStdRailHight)
					{
						result = false;
						sMsg = this.CreateStrMsg(checkDataByBuildType.m_sArchStdName, "扶手高度", "大于等于", checkDataByBuildType.m_StairArchStdRailData.m_dStairArchStdRailHight.ToString("f0"), false, "");
					}
					else
					{
						sMsg = "OK";
					}
				}
				break;
			case StairArchStdBuildingType.SASBT_Kindergarten:
				if (checkDataByBuildType != null)
				{
					if (dHeight > checkDataByBuildType.m_StairArchStdRailData.m_dStairArchStdRailHight)
					{
						result = false;
						sMsg = this.CreateStrMsg(checkDataByBuildType.m_sArchStdName, "扶手高度", "小于等于", checkDataByBuildType.m_StairArchStdRailData.m_dStairArchStdRailHight.ToString("f0"), false, "");
					}
					else
					{
						sMsg = "OK";
					}
				}
				break;
			case StairArchStdBuildingType.SASBT_MidLittleSchool:
			case StairArchStdBuildingType.SASBT_Shop:
			case StairArchStdBuildingType.SASBT_Hospital:
			case StairArchStdBuildingType.SASBT_OldPeopleBuilding:
				sMsg = "OK";
				break;
			}
			return result;
		}

		public bool CheckStairRailIndoorHeight(StairArchStdBuildingType buildType, double dHeight, ref string sMsg)
		{
			bool result = true;
			StairArchStdData checkDataByBuildType = this.GetCheckDataByBuildType(buildType);
			switch (buildType)
			{
			case StairArchStdBuildingType.SASBT_Residence:
			case StairArchStdBuildingType.SASBT_Kindergarten:
			case StairArchStdBuildingType.SASBT_Hospital:
			case StairArchStdBuildingType.SASBT_OldPeopleBuilding:
				sMsg = "OK";
				break;
			case StairArchStdBuildingType.SASBT_MidLittleSchool:
			{
				SchoolStairArchStdRailData schoolStairArchStdRailData = checkDataByBuildType.m_StairArchStdRailData as SchoolStairArchStdRailData;
				if (dHeight < schoolStairArchStdRailData.m_dStairArchStdIndoorRailHight)
				{
					result = false;
					sMsg = this.CreateStrMsg(checkDataByBuildType.m_sArchStdName, "室内栏杆高度", "大于等于", schoolStairArchStdRailData.m_dStairArchStdIndoorRailHight.ToString("f0"), false, "");
				}
				else
				{
					sMsg = "OK";
				}
				break;
			}
			case StairArchStdBuildingType.SASBT_Shop:
			{
				ShopStairArchStdRailData shopStairArchStdRailData = checkDataByBuildType.m_StairArchStdRailData as ShopStairArchStdRailData;
				if (dHeight < shopStairArchStdRailData.m_dStairArchStdIndoorRailHight)
				{
					result = false;
					sMsg = this.CreateStrMsg(checkDataByBuildType.m_sArchStdName, "室内栏杆高度", "大于等于", shopStairArchStdRailData.m_dStairArchStdIndoorRailHight.ToString("f0"), false, "");
				}
				else
				{
					sMsg = "OK";
				}
				break;
			}
			}
			return result;
		}

		public bool CheckStairRailOutdoorHeight(StairArchStdBuildingType buildType, double dHeight, ref string sMsg)
		{
			bool result = true;
			StairArchStdData checkDataByBuildType = this.GetCheckDataByBuildType(buildType);
			switch (buildType)
			{
			case StairArchStdBuildingType.SASBT_Residence:
			case StairArchStdBuildingType.SASBT_Kindergarten:
			case StairArchStdBuildingType.SASBT_Hospital:
			case StairArchStdBuildingType.SASBT_OldPeopleBuilding:
				sMsg = "OK";
				break;
			case StairArchStdBuildingType.SASBT_MidLittleSchool:
			{
				SchoolStairArchStdRailData schoolStairArchStdRailData = checkDataByBuildType.m_StairArchStdRailData as SchoolStairArchStdRailData;
				if (dHeight < schoolStairArchStdRailData.m_dStairArchStdOutdoorRailHight)
				{
					result = false;
					sMsg = this.CreateStrMsg(checkDataByBuildType.m_sArchStdName, "室外栏杆高度", "大于等于", schoolStairArchStdRailData.m_dStairArchStdOutdoorRailHight.ToString("f0"), false, "");
				}
				else
				{
					sMsg = "OK";
				}
				break;
			}
			case StairArchStdBuildingType.SASBT_Shop:
			{
				ShopStairArchStdRailData shopStairArchStdRailData = checkDataByBuildType.m_StairArchStdRailData as ShopStairArchStdRailData;
				if (dHeight < shopStairArchStdRailData.m_dStairArchStdOutdoorRailHight)
				{
					result = false;
					sMsg = this.CreateStrMsg(checkDataByBuildType.m_sArchStdName, "室外栏杆高度", "大于等于", shopStairArchStdRailData.m_dStairArchStdOutdoorRailHight.ToString("f0"), false, "");
				}
				else
				{
					sMsg = "OK";
				}
				break;
			}
			}
			return result;
		}

		public bool CheckStairRailSpace(StairArchStdBuildingType buildType, double dSpace, ref string sMsg)
		{
			bool result = true;
			StairArchStdData checkDataByBuildType = this.GetCheckDataByBuildType(buildType);
			if (buildType > StairArchStdBuildingType.SASBT_MidLittleSchool)
			{
				if (buildType - StairArchStdBuildingType.SASBT_Shop <= 2)
				{
					sMsg = "OK";
				}
			}
			else if (checkDataByBuildType != null)
			{
				string sArchStdName = checkDataByBuildType.m_sArchStdName;
				if (dSpace > checkDataByBuildType.m_StairArchStdRailData.m_dStairArchStdRailSpace)
				{
					result = false;
					sMsg = this.CreateStrMsg(sArchStdName, "栏杆杆件净距", "小于等于", checkDataByBuildType.m_StairArchStdRailData.m_dStairArchStdRailSpace.ToString("f0"), false, "");
				}
				else
				{
					sMsg = "OK";
				}
			}
			return result;
		}

		public bool CheckStairSlope(StairArchStdBuildingType buildType, double dDeg, ref string sMsg)
		{
			bool result = true;
			StairArchStdData checkDataByBuildType = this.GetCheckDataByBuildType(buildType);
			if (checkDataByBuildType != null)
			{
				string sArchStdName = checkDataByBuildType.m_sArchStdName;
				switch (buildType)
				{
				case StairArchStdBuildingType.SASBT_Residence:
				case StairArchStdBuildingType.SASBT_Kindergarten:
				case StairArchStdBuildingType.SASBT_Shop:
				case StairArchStdBuildingType.SASBT_Hospital:
				case StairArchStdBuildingType.SASBT_OldPeopleBuilding:
					sMsg = "OK";
					break;
				case StairArchStdBuildingType.SASBT_MidLittleSchool:
				{
					SchoolStairArchStdLadderData schoolStairArchStdLadderData = null;
					foreach (BaseStairArchStdLimitCondition baseStairArchStdLimitCondition in checkDataByBuildType.m_ListStairArchStdCondition)
					{
						if (baseStairArchStdLimitCondition.m_StairArchStdLadderData is SchoolStairArchStdLadderData)
						{
							result = false;
							schoolStairArchStdLadderData = (baseStairArchStdLimitCondition.m_StairArchStdLadderData as SchoolStairArchStdLadderData);
							break;
						}
					}
					if (schoolStairArchStdLadderData != null)
					{
						if (dDeg > schoolStairArchStdLadderData.m_dStairArchStdSlope)
						{
							sMsg = this.CreateStrMsg(sArchStdName, "楼梯坡度", "小于等于", schoolStairArchStdLadderData.m_dStairArchStdSlope.ToString("f0"), false, "");
						}
					}
					else
					{
						sMsg = "OK";
					}
					break;
				}
				}
			}
			return result;
		}

		private static List<StairArchStdData> m_ListCheckData;

		private static Dictionary<string, BaseStairArchStdLandData> m_DicCheckLandData;

		private static Dictionary<string, BaseStairArchStdLadderDataNew> m_DicCheckRunData;

		private static StairsClearHeightData m_ClearHeightData;

		private class baseXmlData
		{
			public string name;

			public string id;
		}

		private class ResidenceXmlData : StairArchStd.baseXmlData
		{
			public string PublicStairName;

			public string PublicStairId;

			public string StairSevenWidth;

			public string StairSixWidth;

			public string PublicTreadHight;

			public string PublicTreadWidth;

			public string IndoorStairName;

			public string IndoorStairId;

			public string NearSpaceWidth;

			public string TwoSideWidth;

			public string IndoorTreadHight;

			public string IndoorTreadWidth;

			public string SpecialEmergencyStairName;

			public string SpecialEmergencyStairId;

			public string SpecialTreadHight;

			public string SpecialTreadWidth;

			public string OtherBuildStairName;

			public string OtherBuildStairId;

			public string OtherTreadHight;

			public string OtherTreadWidth;

			public string RailHight;

			public string RailSpace;

			public string LandWidth;

			public string RailHorizontalLength;

			public string RailHorizontalHight;

			public string Mark;
		}

		private class KindergartenXmlData : StairArchStd.baseXmlData
		{
			public string StairName;

			public string StairId;

			public string TreadHight;

			public string TreadWidth;

			public string RailHight;

			public string RailSpace;

			public string Mark;
		}

		private class MidLittleSchoolXmlData : StairArchStd.baseXmlData
		{
			public string StairName;

			public string StairId;

			public string StairSpaceWidth;

			public string StairSlope;

			public string RailIndoorHight;

			public string RailOutdoorHight;

			public string RailSpace;

			public string RailHorizontalLength;

			public string RailHorizontalHight;

			public string Mark;
		}

		private class ShopXmlData : StairArchStd.baseXmlData
		{
			public string StairName;

			public string StairId;

			public string StairSpaceWidth;

			public string TreadHight;

			public string TreadWidth;

			public string RailIndoorHight;

			public string RailOutdoorHight;

			public string Mark;
		}

		private class HospitalXmlData : StairArchStd.baseXmlData
		{
			public string StairName;

			public string StairId;

			public string StairSpaceWidth;

			public string TreadHight;

			public string TreadWidth;

			public string LandWidth;

			public string Mark;
		}

		private class OldPeopleBuildingXmlData : StairArchStd.baseXmlData
		{
			public string StairName;

			public string StairId;

			public string StairSpaceWidth;

			public string HomeTreadHight;

			public string HomeTreadWidth;

			public string PublicTreadHight;

			public string PublicTreadWidth;

			public string Mark;
		}
	}
}
